<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script src="${ctx}/common/base/tools-login.js"></script>
<body class="container login-body">
	<div class="col-lg-12 text-right">
			<c:if test="${empty loginUser}">
				<a href="javascript:void(0);" onclick="toLogin();">登录</a> &nbsp;&nbsp; 
				<a href="javascript:void(0);" onclick="toReg();">注册</a>
			</c:if>
			<c:if test="${!empty loginUser}">
				欢迎您&nbsp;<input type="hidden" name="top_login_frame_user_ename" value="${loginUser.userEname}"/><input type="hidden" name="top_login_frame_user_cname" value="${loginUser.userCname}"/><input type="hidden" name="top_login_frame_user_id" value="${loginUser.userId}"/>
				<span class="user dropdown navbar-right">
					<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
						<i class="fa fa-user fx2"></i> ${loginUser.userEname}<span class="caret"></span>
					</a>
					<ul class="dropdown-menu">
						<c:if test="${loginUser.userType =='manager' || loginUser.userType =='broker'}">
							<li><a href="javascript:void(0);" onclick="toUserManager('/admin/index')" title="进入管理中心"><i class="fa fa-user fx8"></i> ${loginUser.userCname}</a></li>
			    		</c:if>
			    		<c:if test="${loginUser.userType =='customer' }">
					    	<li><a href="javascript:void(0);" onclick="toUserManager('/web/user/index')"><i class="fa fa-angle-double-right fx8"></i> 用户中心</a></li>
			    		</c:if>
			     		<li><a href="javascript:void(0);" onclick="logoutIndex()"><i class="fa fa-sign-out fx8"></i> 退 出</a></li>
					</ul>
				</span>
			</c:if>
	</div>
</body>

<script>
function toReg(){
	window.location.href=ctx+"/sendPage/"+sysName+"/web/reg/reg-index";
}
function toLogin(){
	loginIndex(sysName);
}
function toUserManager(flagURL){
    window.location.href=ctx+"/sendPage/"+sysName+flagURL;
}
</script>